docs: clarify a caveat with COPY --link and overwriting directory permissions#6778
docs: clarify a caveat with COPY --link and overwriting directory permissions#6778jsternberg wants to merge 1 commit into
COPY --link and overwriting directory permissions#6778Conversation
| conditions for cache reuse. | ||
|
|
||
| When copying a path into a subdirectory, `--link` will always create the | ||
| parent directories with the default directory creation settings and will always |
There was a problem hiding this comment.
always create the
parent directories with the default directory creation settings
I think it creates the parent directories in whatever settings that were set by the copy command.
There was a problem hiding this comment.
My observed behavior was that parent directories were created with 0755. I'm not sure if that's what's intended but it was the behavior I saw.
There was a problem hiding this comment.
Should be the same as COPY without --link on top of scratch stage.
There was a problem hiding this comment.
This may be related to umask. I tested this on a Mac with Docker Desktop and the VM seems to have a umask of 0022 which may have influenced the results. The code to create these directories seems to be intended to use the --chmod setting but umask may have interfered here.
There was a problem hiding this comment.
I made a note about umask in the COPY --chmod section and how it can affect creating parent directories.
There was a problem hiding this comment.
Umask of the system should never affect the output of buildkit. We are clearing umask in https://github.com/moby/buildkit/blob/master/cmd/buildkitd/main_unix.go#L19
…ermissions Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
9b10935 to
d87c25f
Compare
Closes #3602.